﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using MII_FIF.Layouts;

namespace MII_FIF.ControlTemplates.MII_FIF
{
    public partial class LeftMenu : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            aNAS.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/NAS/ViewNAS.aspx");
            aOS.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/OS/ViewOS.aspx");
            aRouter.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/Router/ViewRouter.aspx");
            aSystemBrand.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/SystemBrand/ViewSystemBrand.aspx");
            aSystemType.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/SystemType/ViewSystemType.aspx");
            aPrinter.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/Printer/ViewPrinter.aspx");
            aProvider.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/Provider/ViewProvider.aspx");
            aVendor.HRef = Layouts.Generic.GenLink("/_layouts/MII_FIF/Master/Vendor/ViewVendor.aspx");
            aDataCabang.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/DataCabang/ViewDataCabang.aspx");
            aCRNetwork.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/ChangeRequest/ViewCRNetwork.aspx");
            aCRPhysical.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/ChangeRequest/ViewCRPhysical.aspx");
            aCRStorage.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/ChangeRequest/ViewCRStorage.aspx");
            aCRVMWare.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/ChangeRequest/ViewCRVMWare.aspx");
            aDMPhysical.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/DeviceManagement/ViewPhysicalServer.aspx");
            aDMNetwork.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/DeviceManagement/ViewNetworkDevice.aspx");
            aDMStorage.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/DeviceManagement/ViewStorage.aspx");
            aDMVM.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/DeviceManagement/ViewVM.aspx");
            aWorkOrder.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/VendorLogBook/ViewWorkOrder.aspx");   
            aTask.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/FormApproval/Task.aspx");
            aLocation.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Master/Location/ViewLocation.aspx");
            aRackNumber.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Master/RackNumber/ViewRackNumber.aspx");
            aDataKunjungan.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/DataKunjungan/ViewDataKunjungan.aspx");
            aVWNet.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Checklist/ViewCHNetworkDevice.aspx");
            aVWPS.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Checklist/ViewCHPhysicalServer.aspx");
            aVWSto.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Checklist/ViewCHStorage.aspx");
            aVWVM.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Checklist/ViewCHVM.aspx");
            aManagePhysical.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/PhysicalData/Manage.aspx");
            aRCHNet.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCHNetwork.aspx");
            aRCHPS.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCHPhysical.aspx");
            aRCHSto.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCHStorage.aspx");
            aRCHVM.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCHVM.aspx");
            aRCRNet.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCRNetwork.aspx");
            aRCRPS.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCRPhysical.aspx");
            aRCRSto.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCRStorage.aspx");
            aRCRVM.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSCRVM.aspx");
            aRCabang.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSDataCabang.aspx");
            aRKunjungan.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSDataKunjungan.aspx");
            aRDevice.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSDevice.aspx");
            aRDeviceRack.HRef = Layouts.Generic.GenLink("/_Layouts/MII_FIF/Report/RSDeviceRack.aspx");            
            if (!Generic.IsUserInGroup(Configuration.DeviceManagementGroupName))
            {
                liDeviceManagement.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.ManagePDGroupName))
            {
                liManagePhysical.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.WorkOrderGroupName))
            {
                liWorkOrder.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.MasterGroupName))
            {
                liMaster.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.DataCabangGroupName))
            {
                liDataCabang.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.DataKunjunganGroupName))
            {
                liDataKunjungan.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.ReportGroupName))
            {
                liReport.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.ChecklistGroupName))
            {
                liViewChecklist.Visible = false;
            }
            if (!Generic.IsUserInGroup(Configuration.ChangeRequestGroupName))
            {
                liChangeRequest.Visible = false;
            }
            if (!Generic.isFullControl())
            {
                liMaster.Visible = false;
            }
        }
    }
}